package util;

import java.util.*;

/**
 * Created by Administrator on 2017/5/20 0020.
 * 对scene_id缓存
 */
public class SceneCache {

    // 静态变量，做缓存
    public static Map<Integer, String> cacheMap = new HashMap<Integer, String>();

    public static void setTimerTask() {
        TimerTask timerTask=new TimerTask() {
            @Override
            public void run() {
                cacheMap=new HashMap<Integer, String>();
            }
        };

        // 定时删除
        Calendar calendar=Calendar.getInstance();
        int year=calendar.get(Calendar.YEAR);
        int month=calendar.get(Calendar.MONTH);
        int day=calendar.get(Calendar.DAY_OF_MONTH);
        calendar.set(year,month,day,3,0,00);
        Date date=calendar.getTime();

        Timer timer=new Timer();

        // 执行定时任务
        timer.schedule(timerTask,date);

    }

}
